
import config from "@/config";  // 配置文件
const user = {
  state: {
	footerHeight:0,
	
  },

  mutations: {
    SET_HEIGHT:(state, data)=>{
	  state.footerHeight = data
    }
  },

  actions: {
    uploadFilePromise({ commit }, url) {
  		return new Promise((resolve, reject) => {
  			uni.showLoading({
  			   title: '加载中'
  			});
  			uni.uploadFile({
  				url: `${config.uni_app_web_api_url}/common/upload/qiniu`, // 仅为示例，非真实的接口地址
  				filePath: url,
  				name: 'file',
  				// formData: {
  				// 	user: 'test'
  				// },
  				success: (res) => {
  					setTimeout(() => {
  						let data = JSON.parse(res.data)
  						uni.hideLoading();
  						resolve(data)
  					}, 1000)
  				}
  			});
  		})
    },
  }
}

export default user
